//
//  ByMemberStoreSuccessVC.m
//  mijifen_ios
//
//  Created by mc on 2017/10/31.
//  Copyright © 2017年 itboye. All rights reserved.
//

#import "ByMemberStoreSuccessVC.h"

// view
#import "ByViewHeaderSuccess.h"

@interface ByMemberStoreSuccessVC ()

@end

@implementation ByMemberStoreSuccessVC

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"会员储值";
    self.view.backgroundColor = BY_TABLE_COLOR;
    [self addLeftBackBarButtonItem];
    [self createViews];

}

#pragma mark - 创建成功
- (void)createViews{
    ByViewHeaderSuccess *headerView = [[ByViewHeaderSuccess alloc] initWith:@"StoreCollection_paysuccess" title:@"储值成功"];
    [self.view addSubview:headerView];
    __block CGFloat height;
    [headerView mas_makeConstraints:^(MASConstraintMaker *make) {
        if (@available(iOS 11.0,*)) {
            height = (self.view.height - 50 * 2 - 10 - self.view.safeAreaInsets.bottom) / 2;
            make.top.equalTo(self.view.mas_safeAreaLayoutGuideTop);
            make.size.mas_equalTo(CGSizeMake(SCREEN_WIDTH, height));
        }else{
            height = (self.view.height - 50 * 2 - 10) / 2;
            make.top.equalTo(self.view.mas_top);
            make.size.mas_equalTo(CGSizeMake(SCREEN_WIDTH, height));
        }
        
    }];
    
    UIButton *backButton = [[UIButton alloc] init];
    [self.view addSubview:backButton];
    [backButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.view.mas_left);
        if (@available(iOS 11.0,*)) {
            make.bottom.equalTo(self.view.mas_safeAreaLayoutGuideBottom);
        }else{
            make.bottom.equalTo(self.view.mas_bottom);
        }
        make.size.mas_equalTo(CGSizeMake(SCREEN_WIDTH, 50));
    }];
    [backButton setTitle:@"返回首页" forState:UIControlStateNormal];
    [backButton setTitleColor:BY_TEXT_COLOR forState:UIControlStateNormal];
    [backButton setBackgroundColor:BY_THEME_COLOR];
    
    // 恭喜
    UILabel *gongxiLabel = [[UILabel alloc] init];
    [self.view addSubview:gongxiLabel];
    [gongxiLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(headerView.mas_bottom).offset(25);
        make.size.mas_equalTo(CGSizeMake(SCREEN_WIDTH, 40));
    }];
    gongxiLabel.textAlignment = NSTextAlignmentCenter;
    gongxiLabel.textColor = BY_TEXT_COLOR;
    gongxiLabel.font = B_FONT(40);
    gongxiLabel.text = @"恭喜";
    
    // 手机号
    UILabel *phoneLabel = [[UILabel alloc] init];
    [self.view addSubview:phoneLabel];
    [phoneLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(gongxiLabel.mas_bottom).offset(25);
        make.size.mas_equalTo(CGSizeMake(SCREEN_WIDTH, 20));
    }];
    phoneLabel.font = FONT(18);
    phoneLabel.textAlignment = NSTextAlignmentCenter;
    phoneLabel.text = self.phone;
    
    // 图片
    UIImageView *img = [[UIImageView alloc] init];
    [self.view addSubview:img];
    [img mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(phoneLabel.mas_bottom).offset(25);
        make.left.equalTo(@((SCREEN_WIDTH - 50) / 2));
        make.size.mas_equalTo(CGSizeMake(50, 50));
    }];
    img.image = [UIImage imageNamed:@"Index_memberStore"];
    
    // 储值金额
    UILabel *priceLabel = [[UILabel alloc] init];
    priceLabel.numberOfLines = 0;
    [self.view addSubview:priceLabel];
    [priceLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(img.mas_bottom).offset(20);
        make.left.equalTo(self.view.mas_left);
        make.size.mas_equalTo(CGSizeMake(SCREEN_WIDTH, 20));
    }];
    priceLabel.textAlignment = NSTextAlignmentCenter;
    priceLabel.text = self.price;
    
 
    
    
}



@end
